<?php
/**
 * @Author: rocky
 * Date: 2019/12/11
 * Time: 14:30
 */


namespace app\shop\resource;


use app\common\resource\BaseResource;
use app\shop\model\ShopGoodsSpec;

class SpellGoodResoure extends BaseResource
{
    public function toArray($data){
        $good = $data['good'];
        $spec = ShopGoodsSpec::where('gid',$good['id'])->where('is_deleted',0)->removeOption('order')->order('price')->find();
        return [
            'id'=>$good['id'],
            'title'=>$good['title'],
            'price'=>$good['price'],
            'spell_price'=>$spec['spell_price'],
            'logo'=>$good['logo'],
        ];
    }
}